package global {
	
	import UnityEngine.Input;
	import UnityEngine.Mathf;
	import UnityEngine.MonoBehaviour;
	import UnityEngine.Quaternion;
	import UnityEngine.Transform;
	import UnityEngine.Serialization.IDeserializable;
	import UnityEngine.Serialization.PPtrRemapper;
	import UnityEngine.Serialization.SerializedStateReader;
	import UnityEngine.Serialization.SerializedStateWriter;
	import System.Type;
	
	public class Txs_CameraMotor extends MonoBehaviour implements IDeserializable {
		
		public var Txs_CameraMotor$characterMotor$: Transform;
		
		public var Txs_CameraMotor$rotSpeed$: Number = 0;
		
		public var Txs_CameraMotor$y$: Number = 0;
		
		public var Txs_CameraMotor$minY$: Number = 0;
		
		public var Txs_CameraMotor$maxY$: Number = 0;
		
		public function Txs_CameraMotor_Constructor(): Txs_CameraMotor {
			this.MonoBehaviour_Constructor();
			this.Txs_CameraMotor$rotSpeed$ = 3;
			this.Txs_CameraMotor$minY$ = -80;
			this.Txs_CameraMotor$maxY$ = 80;
			return this;
		}
		
		public function Txs_CameraMotor_Start(): void {
			this.Txs_CameraMotor$y$ = this.Component_transform.eulerAngles.x;
		}
		
		public function Txs_CameraMotor_Update(): void {
			if (Input.Input_GetMouseButton_Int32(0)) {
				var $num: Number = this.Txs_CameraMotor$characterMotor$.eulerAngles.y;
				this.Txs_CameraMotor$y$ = this.Txs_CameraMotor$y$ + (Input.Input_GetAxis_String("Mouse Y") * this.Txs_CameraMotor$rotSpeed$);
				this.Txs_CameraMotor$y$ = Txs_CameraMotor_ClampAngle_Single_Single_Single(this.Txs_CameraMotor$y$, this.Txs_CameraMotor$minY$, this.Txs_CameraMotor$maxY$);
				var $rotation: Quaternion = Quaternion.Euler_Single_Single_Single(-this.Txs_CameraMotor$y$, $num, Number(0));
				this.Component_transform.rotation = $rotation.cil2as::Copy();
			}
		}
		
		public static function Txs_CameraMotor_ClampAngle_Single_Single_Single($angle: Number, $min: Number, $max: Number): Number {
			if ($angle < Number(-360)) {
				$angle = $angle + Number(360);
			}
			if ($angle > Number(360)) {
				$angle = $angle - Number(360);
			}
			return Mathf.Clamp_Single_Single_Single($angle, $min, $max);
		}
		
		cil2as static function DefaultValue(): Txs_CameraMotor {
			return new Txs_CameraMotor().Txs_CameraMotor_Constructor();
		}
		
		public function Deserialize(reader: SerializedStateReader): void {
			this.Txs_CameraMotor$characterMotor$ = reader.ReadUnityEngineObject() as Transform;
			this.Txs_CameraMotor$rotSpeed$ = reader.ReadFloat();
		}
		
		public function Serialize(writer: SerializedStateWriter): void {
			writer.WriteUnityEngineObject(this.Txs_CameraMotor$characterMotor$);
			writer.WriteFloat(this.Txs_CameraMotor$rotSpeed$);
		}
		
		public function RemapPPtrs(remapper: PPtrRemapper): void {
			this.Txs_CameraMotor$characterMotor$ = remapper.GetNewInstanceToReplaceOldInstance(this.Txs_CameraMotor$characterMotor$) as Transform;
		}
		
		public static function get $Type(): System.Type {
			return _$Type != null ? _$Type : (_$Type = new System.Type(Txs_CameraMotor, {"Start" : "Txs_CameraMotor_Start", "Update" : "Txs_CameraMotor_Update", "ClampAngle" : "Txs_CameraMotor_ClampAngle_Single_Single_Single"}, MonoBehaviour.$Type));
		}
		
		public static var _$Type: System.Type;
	}
}
